<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>购买</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <include file="Index/common_css"/>
    <link href="__PUBLIC__/admin/css/plugins/iCheck/custom.css" rel="stylesheet">
</head>

<body>
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">

                <div class="ibox-title">
                    <h3>资金管理 ><small class="m-l-sm">入金申请</small></h3>
                </div>
                <div class="ibox-content" style="background-color:#edf1f2;height: 200px;margin-bottom: 50px;" >
                    <div class="list-group">{$set.remarks}</div>
                </div>

                <form action="__MODULE__/Capital/Into_gold_pay" method="post"  class="form form-horizontal" id="form_gold_add"  target="window.open('__MODULE__/Capital/Into_gold_pay')">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">账号：</label>
                        <div class="col-sm-4">
                            <select class="form-control" style="height: 32px;" name="mt4" id="mt4">
                                <option value="{$user.user_id}">{$user.user_id}</option>
                            </select>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-3 control-label">姓名：</label>
                        <div class="col-sm-4">
                            <input type="text" value="{$user.name_zh_cn}" id="user_name"  name="user_name" disabled class="form-control" />
                        </div>
                    </div>

                    <div class="form-group" >
                        <label class="col-sm-3 control-label">支持卡种：</label>
                        <div class="col-sm-4">
                            <select class="form-control" style="height: 32px;" name="type">
                                <option value="01">人民币借记卡</option>
                            </select>
                        </div>
                        <div class="col-sm-4 ng-scope">
                            <label class="help-block m-b-none" id="bankname_alert" style="color: red;" ></label>
                        </div>
                    </div>

                    <div class="form-group" >
                        <label class="col-sm-3 control-label">货币：</label>
                        <div class="col-sm-4">
                            <select class="form-control" style="height: 32px;" name="currency">
                                <option value="01">USD</option>
                            </select>
                        </div>
                        <div class="col-sm-4 ng-scope">
                            <label class="help-block m-b-none" id="" style="color: red;" ></label>
                        </div>
                    </div>

                    <div class="form-group" >
                        <label class="col-sm-3 control-label">支付方式：</label>
                        <div class="col-sm-4">
                            <select class="form-control" style="height: 32px;" id="bank" name="bank">
                                <!--<option value="01">收银台支付</option>-->
								<option value="02">渠道支付</option>
                                <option value="03">银联支付</option>
								<!--<option value="04">网银支付</option>-->
                            </select>
                        </div>
                        <div class="col-sm-4 ng-scope">
                            <label class="help-block m-b-none"  style="color: red;" ></label>
                        </div>
                    </div>
<!--
                    <div class="form-group" >
                        <label class="col-sm-3 control-label">选择银行：</label>
                        <div class="col-sm-4">
                            <select class="form-control" style="height: 32px;" id="bankbankCode" name="bankCode">
                                <option value="1041000">中国银行</option>
                                <option value="1031000">中国农业银行</option>
                                <option value="1021000">中国工商银行</option>
                                <option value="1051000">中国建设银行</option>
                                <option value="3012900">交通银行</option>
                                <option value="3085840">招商银行</option>
                                <option value="3051000">中国民生银行</option>
                                <option value="3093910">兴业银行</option>
                                <option value="3102900">上海浦东发展银行</option>
                                <option value="3065810">广东发展银行</option>
                                <option value="3021000">中信银行</option>
                                <option value="3031000">光大银行</option>
                                <option value="4031000">中国邮政储蓄银行</option>
                                <option value="3071000">平安银行</option>
                                <option value="3131000">北京银行</option>
                                <option value="3133010">南京银行</option>
                                <option value="3133320">宁波银行</option>
                                <option value="3222900">上海农村商业银行</option>
                                <option value="5021000">东亚银行</option>
                            </select>
                        </div>
					

                        <div class="col-sm-4 ng-scope">
                            <label class="help-block m-b-none"  style="color: red;" ></label>
                        </div>
                    </div>
					-->
                    <div class="form-group">
                        <label class="col-sm-3 control-label">入金金额：</label>
                        <div class="col-sm-2 ">
                            <div class="input-group">
                                <input type="number" class="form-control" name="usd" id="usd" placeholder="美元">
                                <span class="input-group-addon"><i class="fa fa-dollar"></i></span>
                            </div>
                        </div>
                        <div class="col-sm-2 ">
                            <div class="input-group">
                                <input type="number" class="form-control" name="rmb" id="rmb" placeholder="人民币" disabled>
                                <span class="input-group-addon"><i class="fa fa-jpy"></i></span>
                            </div>
                        </div>

                        <div class="col-sm-4 ng-scope">
                            <label class="help-block m-b-none" id="gold_alert" style="color: red;" ></label>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">手续费及到账：</label>
                        <!--fa fa-database-->
                        <div class="col-sm-2">
                            <div class="input-group">
                                <input type="number"  class="form-control" name="fee" id="fee" placeholder="美元" disabled>
                                <span class="input-group-addon"><i class="fa fa-dollar"></i></span>
                            </div>
                        </div>

                        <div class="col-sm-2">
                            <div class="input-group">
                                <input type="text" class="form-control" id="Arrival" name="Arrival" placeholder="实际到账"  disabled>
                                <span class="input-group-addon"><i class="fa fa-dollar"></i></span>
                            </div>
                        </div>
                    </div>

                    <!--<div class="form-group" >
                        <label class="col-sm-3 control-label">验证码：</label>
                        <div class="col-sm-2">
                            <input type="text"  class="form-control" maxlength="6" name="verify" id="verify" placeholder="验证码">
                            <!--required=""--
                        </div>

                        <div class="col-sm-2 ng-scope">
                            <img id="captcha_img" onclick="this.src='__URL__/checkcode/'+Math.random(0,10000)" title="点击刷新" alt="点击更换" title="点击更换" src="__URL__/checkcode" class="verify">
                        </div>
                        <div class="col-sm-1 ng-scope">
                            <label class="help-block m-b-none" id="verify_alert" style="color: red;" ></label>
                        </div>
                    </div>-->

                    <div class="row cl">
                        <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                            <button type="submit" class="btn btn-w-m btn-success"  id="admin-gold-add" name="admin-role-save">
                                <i class="icon-ok"></i> 提交
                            </button>

                            <button type="reset" style="margin-left: 20px;" href="group.html" class="btn btn-w-m btn-primary">
                                <i class="icon-ok"></i> 取消
                            </button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>


<!-- 全局js -->
<include file="Index/common_js"/>
<!-- Peity -->

<!-- 自定义js -->
<script src="__PUBLIC__/admin/js/content.js?v=1.0.0"></script>
<script src="__PUBLIC__/common/js/layer_show.js"></script>
<!-- iCheck -->
<script src="__PUBLIC__/admin/js/plugins/iCheck/icheck.min.js"></script>
<!-- Peity -->
<script>
    $(document).ready(function () {
        $('.i-checks').iCheck({
            checkboxClass: 'icheckbox_square-green',
            radioClass: 'iradio_square-green',
        });

        var submit1=false;var submit2=false;
        $('#usd').bind('input propertychange', function() {
            var rate = '{$set.rate}'; var max_fee = '{$set.max_fee}';
            var fee  = '{$set.fee}';
            $('#rmb').val(($(this).val()*rate).toFixed(2)); //人民币
            var fees = ($(this).val()*fee).toFixed(2);     //手续费
            if(max_fee=='' ||max_fee==0){
                $('#fee').val(($(this).val()*fee).toFixed(2));
                $('#Arrival').val(($(this).val() - fees).toFixed(2));
            }else if(($(this).val()- max_fee) <1){
                $('#fee').val(($(this).val()*fee).toFixed(2));
                $('#Arrival').val((($(this).val() - fees)).toFixed(2));
            }else{
                $('#fee').val(max_fee);
                $('#Arrival').val((($(this).val() - max_fee)).toFixed(2));
            }
        });

        $("#usd").bind('mouseout',function () {
            var data = $("#usd").val();
            var  minimum= {$set.minimum};
            if(data==''){
                $("#gold_alert").html("必填");
                return false;
            }else if(data < minimum){
                $("#gold_alert").html("最低入金$"+ minimum);
                return false;
            }else{
                $("#gold_alert").html("");
                submit1 =true;
            }
        });
        $("#verify").bind('mouseout',function () {
            var verifycode = $("#verify").val();
            $.get("__MODULE__/Capital/verify_date?verify=" + verifycode, function(data) {
                if (data.status==1) {
                    $("#verify_alert").html("");
                    submit2 = true;
                } else {
                    $("#verify_alert").html(data.error);
                    return false;
                }
            })
        });
        $("#admin-gold-add").on('click',function () {
            if(submit1){ /*&& submit2*/
                //var index = layer.load(0, {shade: false});
                var bank=$('#bank').val();
                if(bank=='02'){
                    $('form').attr('action','__MODULE__/Capital/Into_gold_pay');
                    $('form').attr('target',"window.open('__MODULE__/Capital/Into_gold_pay')");
                }else if(bank=='03') {
                    $('form').attr('action', '__MODULE__/Capital/ruilian');
                    $('form').attr('target', "window.open('__MODULE__/Capital/ruilian')");
                }else if(bank=='04'){
                    $('form').attr('action','__MODULE__/Capital/huiCao_pay');
                    $('form').attr('target',"window.open('__MODULE__/Capital/huiCao_pay')");
                }else{
				alert('支付通道已关闭');return;
					//$('form').attr('action','http://funds.kingforx.com/index.php?r=mt4new/index');
                    //$('form').attr('target',"window.open('http://funds.kingforx.com/index.php?r=mt4new/index')");
				}
                $('form').submit();
            }else{
                layer.msg('请确保信息完整正确',{
                    time: 2000,
                });
                return false;
            }
        });
    });

</script>
</body>
</html>
